﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.AddEditCar.Delete_execute = function (screen) {
    screen.Car.deleteEntity();
};
myapp.AddEditCar.Car_Image_render = function (element, contentItem) {
    createImageUploader(element, contentItem, "max-width: 300px; max-height: 300px");
};
myapp.AddEditCar.created = function (screen) {
    // Write code here.
    if (screen.MovementDate == null) {
        var today = new Date();
        //today.setHours(0, 0, 0, 0);
        screen.MovementDate = today;
    }
};
myapp.AddEditCar.Details_postRender = function (element, contentItem) {
    // Write code here.
    contentItem.dataBind("screen.Car.Id", function (newValue) {
        contentItem.screen.details.displayName = "Car (" + (newValue == null ? "New" : newValue) + ")";
    });
};